/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package boundless.entities;

import java.io.Serializable;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Embeddable;
import javax.validation.constraints.NotNull;

/**
 *
 * @author hendrikdekock
 */
@Embeddable
public class GamehistoryPK implements Serializable {
    @Basic(optional = false)
    @NotNull
    @Column(name = "TEAM1ID")
    private int team1id;
    @Basic(optional = false)
    @NotNull
    @Column(name = "TEAM2ID")
    private int team2id;
    @Basic(optional = false)
    @NotNull
    @Column(name = "WEEK")
    private int week;

    public GamehistoryPK() {
    }

    public GamehistoryPK(int team1id, int team2id, int week) {
        this.team1id = team1id;
        this.team2id = team2id;
        this.week = week;
    }

    public int getTeam1id() {
        return team1id;
    }

    public void setTeam1id(int team1id) {
        this.team1id = team1id;
    }

    public int getTeam2id() {
        return team2id;
    }

    public void setTeam2id(int team2id) {
        this.team2id = team2id;
    }

    public int getWeek() {
        return week;
    }

    public void setWeek(int week) {
        this.week = week;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (int) team1id;
        hash += (int) team2id;
        hash += (int) week;
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof GamehistoryPK)) {
            return false;
        }
        GamehistoryPK other = (GamehistoryPK) object;
        if (this.team1id != other.team1id) {
            return false;
        }
        if (this.team2id != other.team2id) {
            return false;
        }
        if (this.week != other.week) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "boundless.entities.GamehistoryPK[ team1id=" + team1id + ", team2id=" + team2id + ", week=" + week + " ]";
    }
    
}
